#include<stdio.h>
#include<unistd.h>
#include<stdlib.h>
int main()
{

   printf("I am arunning!....");
   pid_t id=fork();
   //chile
    if(id==0){
		int count=5;
         while(count)
         {
             printf("I am child process...PID:%d, PPID:%d,count:%d\n", getpid(), getppid(),count);
             sleep(1);
             count--;
         }
         printf("child quit!\n");
         exit(1);
    }
    //parent
    else if(id>0){
        int count=5;     
        while(count){
            printf("I am father...PID:%d, PPID:%d,count:%d\n", getpid(), getppid(),count);
            sleep(1);
            count--;
        }
        printf("parent quit!...\n");
        exit(0);
    }
    else{
        //fork error
    }
    return 0;
}
